﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PreCommitHook
{
    /// <summary>
    /// Represents the metadata of one unit tests
    /// A metadata for every failed unit tests is collected and exposed via MSCodeCoverageParser.FailedTestsList static collection.
    /// This information is further used for displaying the reason of the rolled back commit and it is also emailed to the appropriate
    /// users according emails.xml content
    /// </summary>
    public class UnitTestMetada : IUnitTestMetada
    {
        public string Name { get; set; }
        public string Description { get; set; }
        public string AssemblyName { get; set; }
        public string TestID { get; set; }
        public string ClassName { get; set; }
        public string Status { get; set; }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(String.Format("Test name: {0}", Name));
            sb.AppendLine(String.Format("Description: {0}", Description));
            sb.AppendLine(String.Format("Class name: {0}", ClassName));
            sb.AppendLine(String.Format("Assembly name: {0}", AssemblyName));
            sb.AppendLine(String.Format("Test ID: {0}", TestID));

            return sb.ToString();
        }
    }
}
